<!DOCTYPE html>
<html lang="ja">
<head>
{{$sp_meta}}
	
	<!-- stylesheets -->
	<link rel="stylesheet" href="sp/assets/css/main.css" media="screen">
	<link rel="stylesheet" href="sp/assets/css/print.css" media="print">
	
	<!-- javascript -->
	<script src="sp/assets/js/func.js" type="text/JavaScript"></script>
	<script src="sp/assets/js/openclose.js" type="text/Javascript"></script>
	<script src="sp/assets/js/search_txt.js" type="text/Javascript"></script>
	<script src="sp/assets/js/jquery-1.4.1.js" type="text/JavaScript"></script>
	<script src="/__utm.js" type="text/javascript"></script>
	<script type="text/javascript">
    function add(the,userid){
    	if(confirm('ほしいものリストに追加する?')){
    		   
    	       $.ajax({
    	           type: "POST",
    	           url: "{{'sp/topList/add'|U}}",
    	           data: "goods_id=" + the+"&login_id="+userid,
    	           success: function (msg) {

    	        	    $("#"+the).hide();
        	           
    	               if (msg == "success") {
    	                 
    	               }
    	               if (msg == "fail") {
    	                 
    	               }
    	           },
    	           error: function (XMLHttpRequest, textStatus, thrownError) {
    	           }
    	       });
    		}
    }
	



	function toPage(thepage) {
		document.form1.page.value =  thepage;
		//document.form1.csv.value="";
		document.form1.submit();
	}

	 function addcart(gid,gNum)
	    {       
		    $.ajax({
		    url:"sp_cart_ajaxgetcart.html",type:"POST",datatype:"text",
		    success: function(msg)
		    {
		    temp=msg
		    if(temp=="")
		    {temp=gid+"-"+gNum;}
		    else
		    {
		    temp=temp +"|"+gid+"-"+gNum;
		    }
		    $.ajax({url:"sp_cart_ajaxsetcart.html",type:"POST", data:"shopjpcart="+temp,
		    success: function(msg2)
		    {
		    if(msg2=='cart ajax success')
		    {
				//提交成功
		    	location.href = "sp_cart_index.html"
		    }
		    }
		    });
		    }
		    })
	    }	
	</script>
</head>

<body>
	<div id="wrapper">
			{{$sp_head}}
		
		<ol id="pan">
			<li><a href="{{'sp/top/index'|U}}">ホーム</a></li>
			<li>カテゴリ</li>
		</ol>
                    <form name="form1"  action="{{'sp/topList/index'|U}}"  method="get" >
                          <input type="hidden" name="page" />
                          <input type="hidden" name="category_id"  value="{{$forms.category_id}}"/>
                    </form>
		<section id="main">
			<div id="search_list">
				<p class="howmany"><em>{{$page.cnt}}</em>件の商品が見つかりました。</p>
						
				<ol class="search_result_count">
				       {{$pageing}}
				</ol>
				<br clear="all">
			
				{{ foreach from=$goods_data key=k item=v name="member" }}
						<ul>
						   <li>
								<dl>
									 {{if ($v.sellbegin and $v.sellbegin!="0000-00-00 00:00:00") or ($v.sellend and $v.sellend!="0000-00-00 00:00:00")}}
									  {{if $v.sellend > $smarty.now|date_format:'%Y-%m-%d %H:%M:%S'}}
									<dt><a href="javascript:void(0)"  onclick=addcart({{$v.id}},1) title="{{$v.goods_name}}を買い物カゴに入れる">買い物カゴに入れる</a></dt>
									  {{else}}
									<em>販売終了しました</em>
									  {{/if}}
									{{else}}
									<em>未発売</em>
									{{/if}}
									
									{{if $user != '' and  $v.Y == ''}}
									<dd id='{{$v.id}}'><a  href="javascript:void(0)" onclick=add({{$v.id}},{{$user.USER_id}}) title="ほしいものリストに追加する">ほしいものリストに追加する</a></dd>
								    {{/if}}
								</dl>
								{{if $set.lgimage==1}}
								<div class="wish_img"><a href="{{'sp/topItem/index'|U}}?id={{$v.id}}" title="{{$v.goods_name}}"><img src="{{$v.goods_image}}" /></a></div>
								{{/if}}
								
								{{if $set.lgname==1}}
								<h3><a href="{{'sp/topItem/index'|U}}?id={{$v.id}}" title="{{$v.goods_name}}">{{$v.goods_name}}</a></h3>
								{{/if}}
								
								{{if $set.lgslogan==1}}
								<h4>{{$v.goods_slogan}}</h4>
								{{/if}}
								<p>
								    {{if $set.lgunitprice==1}}
									定価：<em>{{$v.goods_rate|number_format}}</em>円（税込）<br>
									{{/if}}
									{{$v.goods_style}}<br>
									{{$v.goods_issuedate|date_format:"%Y"}}年{{$v.goods_issuedate|date_format:"%m"}}月発行
								</p>								
							</li>
						</ul>
						{{ /foreach }}				
						
				<ol class="search_result_count">
					{{$pageing}}
				</ol>
				<br clear="all">
			</div>
		</section>

		<section id="r_clm">
			<h3>3,000円以上で送料無料</h3>
			
			<h4><a href="javascript:collapse.slideit()">カテゴリ</a></h4>
			 {{$categorying}}
			
			<h4><a href="javascript:collapse2.slideit()">Information</a></h4>
			<ul id="info">
				<li><a href="">ご利用案内</a></li>
				<li><a href="">求人案内</a></li>
				<li><a href="">図書取扱店</a></li>
				<li><a href="">トピックス</a></li>
				<li><a href="">販売支援</a></li>
				<li><a href="">会社概要</a></li>
				<li><a href="">お問い合せ</a></li>
			</ul>
			
		       {{$chartsing}}
			
			 {{$newsing}}
		</section>
		<br clear="all">

	   {{$sp_foot}}

	</div>

<script type="text/javascript">
	var collapse = new animatedcollapse("cat", 400, true,"block");
	var collapse2 = new animatedcollapse("info", 400, true,"block");
	var collapse3 = new animatedcollapse("ranking", 400, true,"block");
	var collapse4 = new animatedcollapse("whatsnew", 400, true,"block");
</script>

</body>
</html>